//package org.example.controller.douban;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import us.codecraft.webmagic.Spider;
//import us.codecraft.webmagic.pipeline.ConsolePipeline;
//
//@Controller
//@RequestMapping
////启动一个爬虫
//public class DouBanSpider {
//    @Autowired
//    private DouBanDownloader douBanDownloader;
//    @Autowired
//    private DouBanPipeline douBanPipeline;
//    @Autowired
//    private DouBanPageProcessor douBanPageProcessor;
//    @RequestMapping("/start")
//    public void start(){
//        Spider.create(douBanPageProcessor)
////                设置downloader对象
//                .addUrl("http://www.biqugecp.com/class/xuanhuan/1/")
////                设置pipeline组件
//                .setDownloader(douBanDownloader)
//                .addPipeline(douBanPipeline)
//                .addPipeline(new ConsolePipeline())
////                设置scheduler组件 可以不设置
//
////                设置线程数
//                .thread(1)
//                .start();
//
//    }
//}
